package com.zimin.cloud.system.api;

import com.zimin.cloud.mine.pojo.system.business.AccountBO;
import com.zimin.shared.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zimin
 * @since 2022/1/4 5:37 下午
 */
@FeignClient(name = IBaseSystemFeign.SERVER_NAME)
public interface IAccountFeign {


    String ROUTER = "/sys/account";

    /**
     * <p>查询用户列表</p>
     *
     * @param accountBO 查询参数
     * @return com.zimin.shared.pojo.Result
     * @since 2022-02-13 10:38:12
     */
    @GetMapping(ROUTER + "/pageList")
    Result accountPageList(@SpringQueryMap AccountBO accountBO);

    /**
     * <p>保存用户</p>
     *
     * @param accountBO
     * @return com.zimin.shared.pojo.Result
     * @since 2022-02-14 15:55:52
     */
    @PostMapping(ROUTER)
    Result save(@RequestBody @Validated AccountBO accountBO);

    /**
     * <p>修改用户</p>
     *
     * @param accountBO 用户对象
     * @return com.zimin.shared.pojo.Result
     * @since 2022-02-14 15:59:22
     */
    @PutMapping(ROUTER)
    Result update(@RequestBody @Validated AccountBO accountBO);

    /**
     * 批量删除用户
     */
    @DeleteMapping(ROUTER)
    Result delete(@RequestParam(value = "idList") List<String> idList);

    /**
     * <p>重置用户密码</p>
     *
     * @param accountBO 重置对象
     * @return com.zimin.shared.pojo.Result
     * @since 2022-03-16 14:53:42
     */
    @PutMapping(ROUTER + "/resetPassword")
    Result resetPassword(@RequestBody AccountBO accountBO);
}
